//
//  LDBossFionderEduRowView.swift
//  DingDongZP
//
//  Created by 三秒文化 on 16/6/8.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit

class LDBossFionderEduRowView: UIView {
    
    var eduOrga:UILabel?
    var eduOrgaTime:UILabel?
    var eduSpecial:UILabel?
    var model:myResumeCellEduExperModel_edu? {
        didSet{
            updateFrame()
        }
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        setDefaultContent()
        setupFrame()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func updateFrame() {
        eduOrga?.text = model?.institutename
        eduOrgaTime?.text = "\((model?.startdate)! as String) - \((model?.enddate)! as String)"
        eduSpecial?.text = "\(model!.majortitle) | \(model!.edu)"
    }
    func setDefaultContent() {
        
        eduOrga = UILabel.setDetailsLab("XXXX学校", fontSize: 15, titleColor: LDFontColor.Green,Alignment: nil)
        eduOrgaTime = UILabel.setDetailsLab("2011 - 2011", fontSize: 12, titleColor: LDFontColor.DeepGray,Alignment: NSTextAlignment.Right)
        eduSpecial = UILabel.setDetailsLab("专业名称 | 学位", fontSize: 14, titleColor: LDFontColor.DeepGray,Alignment: nil)
        
        addSubview(eduOrga!)
        addSubview(eduOrgaTime!)
        addSubview(eduSpecial!)
    }
    func setupFrame() {
        
        eduOrga?.snp_makeConstraints(closure: { (make) in
            make.left.top.equalTo(0)
            make.size.equalTo(CGSizeMake(180, 18))
        })
        eduOrgaTime?.snp_makeConstraints(closure: { (make) in
            make.top.right.equalTo(0)
            make.size.equalTo(CGSizeMake(120, 15))
        })
        eduSpecial?.snp_makeConstraints(closure: { (make) in
            make.left.right.equalTo(0)
            make.top.equalTo((eduOrga?.snp_bottom)!).offset(LDMargin_V*1.5)
            make.height.equalTo(15)
        })
    }
    
}
